import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        component: () => import('../views/login.vue')
    },
    {
        path: '/home',
        component: () => import('../views/home.vue')
    },
    {
        path: '/main',
        component: () => import('../views/main.vue')
    },
    {
        path: '/dataView',
        redirect: '/bigscreenData',
        component: () => import('../views/dataView/main.vue'),
        children: [
            {
                path: '/upload',
                component: () => import('../views/dataView/components/upload.vue')
            },
            {
                path: '/bigscreenData',
                component: () => import('../views/dataView/components/bigscreenData.vue'),
            },
            {
                path: '/assay',
                component: () => import('../views/dataView/components/assayMain.vue'),
            },
            {
                path: '/waterYield',
                component: () => import('../views/dataView/components/waterYieldMain.vue'),
            },
            {
                path: '/examine',
                component: () => import('../views/dataView/components/examine.vue'),
            },
            {
                path: '/equipment',
                component: () => import('../views/dataView/equipment/index.vue'),
            },
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
